import { AccountState } from '@/store/account/index'
import { GetterTree } from 'vuex'
import { State } from '..'

export interface AccountGetters<S = AccountState> {
  clientName: (state: S) => string
}

const getters: GetterTree<AccountState, State> & AccountGetters = {
  clientName: (state) =>
    state.currentUser?.perms?.find((item) => item.id === state.clientId)
      ?.name || '拍信创意',
}

export default getters
